package com.fast.mybatis.util;

/**
 * @Author likaixuan
 * @Description
 * @Create Date  2018/9/6 22:04
 * @Version 1.0
 */
public class DbFiledConvertJava {

    public static String mysqlFiledConvertJavaType(int fileType) {
        String javaType = "";
        switch (fileType) {
            case 1:
                //VARCHAR
                javaType = "String";
                break;
            case 3:
                //DECIMAL
                javaType = "BigDecimal";
                break;
            case 4:
                //INTEGER
                javaType = "Long";
                break;
            case 5:
                //SMALLINT
                javaType = "Integer";
                break;
            case 7:
                //FLOAT
                javaType = "Float";
                break;
            case 8:
                //DOUBLE
                javaType = "Double";
                break;
            case 12:
                //VARCHAR
                javaType = "String";
                break;
            case 91:
                //DATE,YEAR
                javaType = "Date";
                break;
            case 92:
                //TIME
                javaType = "Time";
                break;
            case 93:
                //DATETIME,TIMESTAMP
                javaType = "Time";
                break;
            case -1:
                //TEXT
                javaType = "String";
                break;
            case -4:
                //BLOB
                javaType = "byte[]";
                break;
            case -5:
                //
                javaType = "";
                break;
            case -6:
                //TINYINT
                javaType = "Integer";
                break;
            case -7:
                //BIT
                javaType = "Boolean";
                break;
            default:
                break;
        }
        return javaType;
    }
}
